﻿<%@ Page Language="C#" MasterPageFile="~/phone/OAMobi.Master" AutoEventWireup="true" CodeBehind="bukashenqing.aspx.cs" Inherits="ZX.WebApp.Phone.HF.bukashenqing" %>
<asp:Content ID="head1" ContentPlaceHolderID="Head" runat="server">
    <script>



        function myCheck() {

            if ($("#qianqialeibie").val() == "") {
                alert("请假类别不能为空");
                return false;
            }
            if ($("#shijiriqi").val() == "") {
                alert("开始日期不能为空");
                return false;
            }
            if (($("#qianqialeibie").val() == "外勤补卡") && $("#shijishijian").val() == "") {
                alert("结束日期不能为空");
                return false;
            }
            if ($("#qianqiayuanyin").val() == "") {
                alert("请假原因不能为空");
                return false;
            }

            return true;

        }

        function OnqjlbChg() {
            if ($("#qianqialeibie").val() == "外勤补卡") {
                $("#shijishijian").attr("required", true);
                $("#shijishijian").css("display", "block");
            }
            else {
                $("#shijishijian").attr("required", false);
                $("#shijishijian").css("display", "none");
            }

        }


        function mySave() {
            if (myCheck()) {
                alert("保存成功");
                location.href = "../MyList.aspx";
            }
        }


        function fnSystemSave() {
            //debugger;
            ///初始化相关参数
            setValue();
            $("#jsonDataContent").val($.toJSON(instance[0]));
            var SaveUrl = url + "?r=" + Math.random() + "&entity=" + entity + "&action=" + action + "&json=" + encodeURI($("#jsonDataContent").val().replace(/&/g, "[A]").replace(/'/g, "[B]"));
            if (typeof (checkData) == "function") {
                if (checkData() == "0") {
                    return;
                }
            }
            ///调用验证
            if (typeof (fnCheckData) == "function") {
                var msg = fnCheckData(instance[0]);
                if (!msg == "") {
                    alert(msg);
                    return;
                }
            }
            //发送保存请求
            YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
                success: responseSuccess
                ,
                failure: responseFailure
            }, null);
        }

    </script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="container">


      <form class="form-signin" role="form" action="../MyList.html" id="from1" onsubmit="return myCheck()"  >
        <h2 class="form-signin-heading">补卡申请</h2>
          <select class="form-control" onchange="OnqjlbChg()"  required autofocus id="qianqialeibie" >
              <option value="">请选择补卡类别</option>
              <option value="上班卡">上班卡</option>
              <option value="下班卡">下班卡</option>
              <option value="外勤补卡">外勤补卡</option>
            </select><br />
        <input type="date" class="form-control"  id="shijiriqi" title="开始日期" required autofocus><br />
        <input type="date" style="display:none;" class="form-control" id="shijishijian" title="结束日期" required autofocus><br />
        <textarea  class="form-control" id="qianqiayuanyin"  placeholder="补卡原因" required autofocus></textarea><br />
        
          
        <input type="button" id="btnSave"  class="btn btn-lg btn-primary btn-block" onclick="mySave()"  value="保存" />
          
      </form>

    </div> <!-- /container -->
</asp:Content>
